#pragma once
#include <cocos2d.h>

USING_NS_CC;

class BaseBuff;
class MainLayer;

class StateBar : public CCNode
{
public:
	StateBar(void);
	~StateBar(void);

	virtual bool init();
	virtual void onEnter();
	virtual void onExit();

	void addBuff(BaseBuff* buff, bool start = true);
	void removeBuff(BaseBuff* buff, bool isStop = true);
	void updateBuffPosition();
	void processing(float dt);

	MainLayer* getMainLayer();

	CC_SYNTHESIZE_RETAIN(CCArray*, _listBuff, Buffs);
	//CC_SYNTHESIZE(bool, _isMagnet, IsMagnet);
	CREATE_FUNC(StateBar);
};

